export default {
  namespaced: true,
  state: {
    isMobile: false,
    theme: localStorage.getItem('setting_theme') || 'dark',
    layout: localStorage.getItem('setting_layout') || 'side',
    systemName: '电力设备状态监测',
    copyright: '2019 云数环能研发',
    homeName: 'home',
    footerLinks: [],
    multipage: localStorage.getItem('setting_multipage') === 'true'
  },
  mutations: {
    setDevice(state, isMobile) {
      state.isMobile = isMobile;
    },
    setTheme(state, theme) {
      localStorage.setItem('setting_theme', theme);
      state.theme = theme;
    },
    setLayout(state, layout) {
      localStorage.setItem('setting_layout', layout);
      state.layout = layout;
    },
    setMultipage(state, multipage) {
      localStorage.setItem('setting_multipage', multipage);
      state.multipage = multipage;
    }
  }
};
